package blocos;

import java.awt.Graphics;
import java.awt.Image;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import blocos.BlockBin;

@SuppressWarnings("serial")
public class BlockBinGUI extends BlockGUI{
	private static String  imgPath = "lixo.jpg";
	
	
	public void paintComponent(Graphics g){
		super.paintComponent(g);			
	}
	
	public BlockBinGUI(){
		super();
		try {
			imgBig = ImageIO.read(new File(defaultImagePathBig+imgPath));
			imgMedium = ImageIO.read(new File(defaultImagePathMedium+imgPath));
			imgSmall = ImageIO.read(new File(defaultImagePathSmall+imgPath));
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		};	
		block = new BlockBin();
	}
	
	public void attachToRightOf (BlockGUI b){
		b.detachAll();
		b.remove();
		this.detachAll();
	}
	public void attachToLeftOf (BlockGUI b){
		b.detachAll();
		b.remove();
		this.detachAll();

	}
	public void attachToTopOf (BlockGUI b){
		b.detachAll();
		b.remove();
		this.detachAll();

	}
	public void attachToBottomOf (BlockGUI b){
		b.detachAll();
		b.remove();
		this.detachAll();

	}
	
	//percistencia
	
	public BlockBinGUI( String [] parametros ){
		super();
		block = new BlockBin();
		int x = Integer.parseInt(parametros[0]);
		int y = Integer.parseInt(parametros[1]);
		this.x = x;
		this.y = y ;
	}
	

	@Override
	public String[] save() {
		String[] p = new String [3];
		p[0]="BlockBinGUI";
		p[1]=Integer.toString(this.x);
		p[2]=Integer.toString(this.y);
		return p;
		
	}
	
}
